public class Data{
	

	private int stn;
	private String date;
	private String time;
	private double temp;
	private double dewp;
	private double stp;
	private double slp;
	private double visib;
	private double wdsp;
	private double prcp;		
	private double sndp;	
	private String frshtt;
	private double cldc;	
	private int wnddir;
	private int[] maxBytes = {6,10,8,5,5,6,6,5,5,4,7,6,4,3};
	
	/**
	 * Gets the station id.
	 *
	 * @return the station id
	 */
	public int getStn() {
		return stn;
	}


	/**
	 * Sets the station id.
	 *
	 * @param stationID the new station id
	 */
	public void setStn(int stn) {
		this.stn = stn;
	}


	/**
	 * Gets the date.
	 *
	 * @return the date
	 */
	public String getDate() {
		return date;
	}


	/**
	 * Sets the date.
	 *
	 * @param date the new date
	 */
	public void setDate(String date) {		
		this.date = date;
	}


	/**
	 * Gets the time.
	 *
	 * @return the time
	 */
	public String getTime() {
		return time;
	}


	/**
	 * Sets the time.
	 *
	 * @param time the new time
	 */
	public void setTime(String time) {
		this.time = time;
	}


	/**
	 * Gets the temp.
	 *
	 * @return the temp
	 */
	public double getTemp() {
		return temp;
	}


	/**
	 * Sets the temp.
	 *
	 * @param temp the new temp
	 */
	public void setTemp(double temp) {
		this.temp = temp;
	}


	/**
	 * Gets the dewp.
	 *
	 * @return the dewp
	 */
	public double getDewp() {
		return dewp;
	}


	/**
	 * Sets the dewp.
	 *
	 * @param dewp the new dewp
	 */
	public void setDewp(double dewp) {
		this.dewp = dewp;
	}


	/**
	 * Gets the stp.
	 *
	 * @return the stp
	 */
	public double getStp() {
		return stp;
	}


	/**
	 * Sets the stp.
	 *
	 * @param stp the new stp
	 */
	public void setStp(double stp) {
		this.stp = stp;
	}


	/**
	 * Gets the slp.
	 *
	 * @return the slp
	 */
	public double getSlp() {
		return slp;
	}


	/**
	 * Sets the slp.
	 *
	 * @param slp the new slp
	 */
	public void setSlp(double slp) {
		this.slp = slp;
	}


	/**
	 * Gets the visib.
	 *
	 * @return the visib
	 */
	public double getVisib() {
		return visib;
	}


	/**
	 * Sets the visib.
	 *
	 * @param visib the new visib
	 */
	public void setVisib(double visib) {
		this.visib = visib;
	}


	/**
	 * Gets the wdsp.
	 *
	 * @return the wdsp
	 */
	public double getWdsp() {
		return wdsp;
	}


	/**
	 * Sets the wdsp.
	 *
	 * @param wdsp the new wdsp
	 */
	public void setWdsp(double wdsp) {
		this.wdsp = wdsp;
	}


	/**
	 * Gets the prcp.
	 *
	 * @return the prcp
	 */
	public double getPrcp() {
		return prcp;
	}


	/**
	 * Sets the prcp.
	 *
	 * @param prcp the new prcp
	 */
	public void setPrcp(double prcp) {
		this.prcp = prcp;
	}


	/**
	 * Gets the sndp.
	 *
	 * @return the sndp
	 */
	public double getSndp() {
		return sndp;
	}


	/**
	 * Sets the sndp.
	 *
	 * @param sndp the new sndp
	 */
	public void setSndp(double sndp) {
		this.sndp = sndp;
	}


	/**
	 * Gets the frshtt.
	 *
	 * @return the frshtt
	 */
	public String getFrshtt() {
		return frshtt;
	}


	/**
	 * Sets the frshtt.
	 *
	 * @param frshtt the new frshtt
	 */
	public void setFrshtt(String frshtt) {
		this.frshtt = frshtt;
	}


	/**
	 * Gets the cldc.
	 *
	 * @return the cldc
	 */
	public double getCldc() {
		return cldc;
	}


	/**
	 * Sets the cldc.
	 *
	 * @param cldc the new cldc
	 */
	public void setCldc(double cldc) {
		this.cldc = cldc;
	}


	/**
	 * Gets the wnddir.
	 *
	 * @return the wnddir
	 */
	public int getWnddir() {
		return wnddir;
	}


	/**
	 * Sets the wnddir.
	 *
	 * @param wnddir the new wnddir
	 */
	public void setWnddir(int wnddir) {
		this.wnddir = wnddir;
	}


	/**
	 * Instantiates a new data.
	 */
	public Data(){
		
	}
	
	public String toString(){
		String measurement = "";
		
		measurement += "Datum: " + date + "\n";
		measurement += "Tijd: " + time + "\n";
		measurement += "Temperatuur: " + temp + "\n";
		measurement += "Dauwpunt: " + dewp + "\n";
		measurement += "Luchtdruk 1: " + stp + "\n";
		measurement += "Luchtdruk 2: " + slp + "\n";
		measurement += "Zichtbaarheid: " + visib + "\n";
		measurement += "Windsnelheid: " + wdsp + "\n";
		measurement += "Neerslag: " + prcp + "\n";
		measurement += "Gevallen sneeuw: " + sndp + "\n";
		measurement += "Gebeurtenissen: " + frshtt + "\n";
		measurement += "Bewolking: " + cldc + "\n";
		measurement += "Windrichting: " + wnddir + "\n";
		
		return measurement;
	}
	
	public String getAllData(){
		String values = "";
		values += resizeData(maxBytes[0], stn+"") + ",";
		//The date is the name of the directory so that doesn't have to be saved to file
		//values += resizeData(maxBytes[1], date+"") + ",";
		values += resizeData(maxBytes[2], time+"") + ",";
		values += resizeData(maxBytes[3], temp+"") + ",";
		values += resizeData(maxBytes[4], dewp+"") + ",";
		values += resizeData(maxBytes[5], stp+"") + ",";
		values += resizeData(maxBytes[6], slp+"") + ",";
		values += resizeData(maxBytes[7], visib+"") + ",";
		values += resizeData(maxBytes[8], wdsp+"") + ",";
		values += resizeData(maxBytes[9], prcp+"") + ",";
		values += resizeData(maxBytes[10], sndp+"") + ",";
		values += resizeData(maxBytes[11], frshtt+"") + ",";
		values += resizeData(maxBytes[12], cldc+"") + ",";
		values += resizeData(maxBytes[13], wnddir+"") + ";";
		return values;
	}
	
	private String resizeData(int length, String x) {
		while(x.length() < length) {
			x += " ";
		}
		return x;
	}

}